OpenBuildings GenerativeComponents Help

The Function Definition Statement

Defines a new function that subsequently can be called within the current body of code.

General Form

resultType functionName(arguments)
{
	statement1
	statement2
	… 
	statementn
}

Example

int SumList(int[] list)
{
	int total = 0;
	foreach (int item in list)
		total += item;
	return total;
}
Print(SumList({5, -2, 4}));        
// Prints '7'.
Print(SumList({1, 3, 4, 10, 6}));   // Prints
'24'.